package com.autumn.xa.a.demo;

import java.util.concurrent.TimeUnit;

/**
 * ClassName: DesktopPet
 * Description:
 * Author: Shen_Yue
 * Date: 2023/4/18 0:00
 * History:
 * <author>          <time>          <version>          <desc>
 * Shen_Yue    2023/4/18 0:00   @Version 1.0        描述
 */
public class DesktopPet {

    private static final String[] PET_FRAMES = {
            "   /\\_/\\",
            "  / o o \\",
            " (   \"   )",
            "  \\~(*)~/"
    };

    private int frameIndex = 0;

    public static void main(String[] args) {
//        DesktopPet pet = new DesktopPet();
//        pet.start();


        Integer integer = Integer.valueOf(2202002);
        Integer a = 2202002;
        a.intValue();

        new Thread().start();
    }

    public void start() {
        while (true) {
            System.out.print("\033[H\033[2J"); // 清屏
            System.out.flush();
            System.out.println(PET_FRAMES[frameIndex]);
            frameIndex = (frameIndex + 1) % PET_FRAMES.length;
            try {
                TimeUnit.MILLISECONDS.sleep(200);
            } catch (InterruptedException e) {
                // Ignore
            }
        }
    }
}
